package com.qf;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;

/**
 * https://doc.hutool.cn/pages/MailUtil/#%E5%85%B6%E5%AE%83
 * https://wx.mail.qq.com/list/readtemplate?name=app_intro.html#/agreement/authorizationCode
 */
public class MailTest {
    public static void main(String[] args) {

        // 根据自己的发件箱配置如下信息
        MailAccount account = new MailAccount();
        account.setHost("smtp.qq.com");
        account.setPort(587);
        account.setAuth(true);
        account.setFrom("212135374@qq.com");
        account.setUser("212135374");
        account.setPass("mwvnuoqofnzgbhjc");

        MailUtil.send(account, CollUtil.newArrayList("212135374@qq.com"), "测试456", "邮件来自Hutool测试456", false
        , FileUtil.file("D:\\pic\\2.gif"));


    }
}
